package me.j360.springboot.simple.bean.search.result;

import me.j360.springboot.simple.bean.search.Search;

/**
 * 说明：
 * Bean类 - 返回结果 - 基类
 *
 * ============================================================================
 * 版权所有 2015 qiushihua。
 *
 * @author qiushihua
 * @version 0.1 2015-08-03
 * ============================================================================
 */
public abstract class Result {

    protected final Search search;

    protected Result(Search search) {
        this.search = search;
    }

    protected abstract static class Builder<T extends Result, B extends Builder<T, B>> {

        private B theBuilder;

        protected Search search;

        public Builder () {
            theBuilder = getThis();
        }

        protected abstract B getThis();

        protected B setSearch(Search search) {
            this.search = search;
            return theBuilder;
        }

        public abstract T build();

    }

}
